<template>
  <view class="layout">
    <index-for-student v-if="configStore.loginRole === '1'" />
    <index-for-teacher v-else />
  </view>
</template>

<script lang="ts" setup>
import { useConfigStore } from "@/store/config";
import indexForStudent from "./components/indexForStudent.vue";
import indexForTeacher from "./components/indexForTeacher.vue";

defineOptions({
  name: "Home",
});
definePage({
  // 使用 type: "home" 属性设置首页，其他页面不需要设置，默认为page
  type: "home",
  style: {
    // 'custom' 表示开启自定义导航栏，默认 'default'
    navigationStyle: "custom",
    navigationBarTitleText: "首页",
  },
});
const configStore = useConfigStore();

onLoad(() => {});

function gotoSportAnalyze() {
  uni.navigateTo({
    url: "/pages-sub/sportAnalyze/index",
  });
}
</script>

<style lang="scss" scoped>
.layout {
  width: 100vw;
  height: 100vh;
  background: #fafafa;
}
.container {
  position: relative;
  height: 275px;
  width: 100%;
}
.bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.banner-image {
  position: absolute;
  width: calc(100% - 20px);
  height: 60px;
  margin: 0 10px;
  z-index: 100;
}
</style>
